using System;
using System.Collections.Generic;
using BlueLotus7.Common;
using BlueLotus7.ArchiveSystem.WCFClients;
using BlueLotus7.ArchiveSystem.IMStatusMonitor.Properties;


namespace BlueLotus7.ArchiveSystem
{
    public static class Global
    {
        private static Logger logger = new Logger("IMStatusMonitor", true, false, "IMStatusMonitor");

        public static Logger Logger
        {
            get
            {
                return logger;
            }
        }

        public static ArchiveStatusServiceClient ServiceClient
        {
            get
            {
                ArchiveStatusServiceClient client = new ArchiveStatusServiceClient();
                if (!string.IsNullOrWhiteSpace(Settings.Default.ClientCredentialsUserName) && !string.IsNullOrWhiteSpace(Settings.Default.ClientCredentialsPassword))
                {
                    client.ClientCredentials.Windows.ClientCredential.UserName = Settings.Default.ClientCredentialsUserName;
                    client.ClientCredentials.Windows.ClientCredential.Password = Settings.Default.ClientCredentialsPassword;
                }

                return client;
            }
        }
    }
}

